﻿@{
    ViewBag.Title = "控制台 - AppSoft2.0.IO - 中山赢友网络科技有限公司";
    Layout = "~/Areas/Backend/Views/Default/_Layout.cshtml";
}
@section HeadContent{
    @Styles.Render("~/AppStyle/Iconfont")
}

<div id="backend-frame" class="winu-position-absolute">
    <div id="backend-leftbar" class="winu-position-absolute">
        <div id="backend-logo">
            <h2>AppSoft.IO</h2>
        </div>
    </div>
    <div id="backend-topbar" class="winu-position-absolute">
        <div class="topbar-left">
            <a id="showModule"><span><i class="iconfont icon-907gongneng more-menu"></i></span></a>
        </div>
        <div class="topbar-right"></div>
    </div>
    <div id="backend-module" class="winu-position-absolute" data-statu="hide"></div>
    <div id="backend-right-container" class="winu-position-absolute">
        <iframe id="mainFrame" name="mainFrame" frameborder="0" src="@Url.Action("Main", "Default")">></iframe>
    </div>
    <div id="global-refresh" class="winu-position-absolute" onclick="document.getElementById('mainFrame').contentWindow.location.reload(true);"><span><i class="iconfont icon-shuaxin"></i></span></div>
</div>
@section FootContent{
    <script type="text/javascript">
        // 设置更多菜单状态
        function setMenuStatu(top, easing, statu) {
            $("#backend-module").animate({
                top: top
            }, {
                easing: easing,
                duration: 100,
                complete: function () {
                    $(this).attr("data-statu", statu);
                }
            });
        }

        var frameDoc = null;
        $("#mainFrame")[0].onload = function () {
            frameDoc = $(window.frames["mainFrame"].document);
            // 隐藏菜单
            $("*").add(frameDoc).on({
                click: function (e) {
                    e = window.event || e;
                    var $obj = $(e.srcElement || e.target);

                    if ($obj.not("#backend-module,#backend-module *")) {
                        var $modules = $("#backend-module");
                        if ($modules.attr("data-statu") == "show") {
                            setMenuStatu("-200px", "easeInCirc", "hide");
                        }
                    }
                }
            });
        }

        $(function () {
            // 显示更多菜单
            $("#showModule").on({
                click: function () {
                    setMenuStatu(0, "easeOutCirc", "show");
                }
            });
        });
    </script>
}